home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00b.txt
/
000116_icon-group-sender_Fri Oct 27 08:00:36 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
4KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9RExmi19487
for icon-group-addresses; Fri, 27 Oct 2000 07:59:48 -0700 (MST)
Message-Id: <200010271459.e9RExmi19487@baskerville.CS.Arizona.EDU>
Date: Fri, 27 Oct 2000 03:04:55 -0200
From: Eduardo Nahum Ochs <edrx@mat.puc-rio.br>
To: icon-group@cs.arizona.edu
Subject: Re: Yet another Newbie question....
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 3729
> This reminds of the (computer nerd) semi-joke "I can write FORTRAN
> in any language". Advanced languages like Icon (and Smalltalk and
> Prolog and ...) are not "conventional". Instead, they provide ways
> to approach problem solutions by thinking differently - which only
> works if you do think "differently". By forcing these languages to
> match a conventional model you are losing most of the advantages
> that the language offers. In that case, why bother with learning the
> language?
Right, but it is often convenient to first learn how to translate some
techniques of the languages you already know into the new language --
for example basic debugging tools, to let you check which values the
variables are getting, to make a program stop when reaching a point
for the nth time, etc...
I think that it is much easier to start coding with a bad style and
learn continuously from reading good code than to pretend that your
mind got entirely blank and then try to learn a new programming
language as if you were suddenly reborn in another planet - possibly a
planet where some of the knowledge comes in the form of mantras like
"a class is like a car, a subclass is like a car window..."
Please, no two programming languages are completely orthogonal to each
other, and Icon is still made of its syntax plus the icode interpreter
(let's think it low-level: interp.r) plus its primitive operations and
functions...
Ok, sorry -- I'm not being ironic, it's just that something occurred
to me that I haven't thought before -- now I recognize that there are
people who get bad programming habits and who would never even think
about getting rid of them -- and worse yet, these are exactly the
"excellent programmers" that can write working 100000-line programs
(these programs that are ugly and unmaintainable, but the market
doesn't care). So, who are we talking about when we say "In that case,
why bother with learning the language"? These people? CS students that
will only use something other than Perl when really forced to? I
confess that almost all professional programmers that I knew
personally (obs: I live in Brazil) are on the same equivalence class
as the old dogs to whom it is impossible to teach new tricks... As for
me, I'm studying maths, all my attempts to program professionally
always failed miserably, and for five years I used Icon for almost
every one-shot program that I had to do -- and it is scaring how we
can program really complex things in a just few minutes with Icon when
we have enough experience.
My $0.02 on what we can do to help saving (:-) those people is just to
make a certain simple piece of code standard. I used to include a file
called "zinc.icn" from all my programs, and zinc.icn defined a
function w and a constant NO such that "w(( expr )|NO)" was always
equivalent to "expr", except maybe for some subtle differences on
backtracking behavior that I never checked. But if "expr" failed then
"w(( expr )|NO)" would print "failed" and fail, and if "expr" didn't
fail then "w(( expr )|NO)" would print the full representation of
"expr" using a recursive function, and return the value of "expr".
I can post my code for "w", but it is somewhat ugly and needs some
cleaning. I also had a trivial wrapper (for Linux) that when called as
"icone expr" executed
$include "zinc.icn"
procedure main(args)
w(( expr )|NO)
end
and I can try to resurrect it; I know that I would have rolled on the
floor with joy if someone had shown me these tricks before I had to
write them myself, but I don't know if other people would be
interested.
More on all this later; questions and flames are welcome.
Cheers for now,
Eduardo Ochs
http://angg.twu.net/
edrx@inx.com.br